﻿<UserControl x:Class="CannedBytes.CommandLineGui.UI.Toolbar" x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:cmd="clr-namespace:CannedBytes.CommandLineGui.Commands"
             xmlns:ui="clr-namespace:CannedBytes.CommandLineGui.UI"
             xmlns:ctrl="clr-namespace:CannedBytes.CommandLineGui.UI.Controls"
             mc:Ignorable="d"
             d:DesignHeight="34" d:DesignWidth="500">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <ui:DropDownButton Grid.Column="0" ToolTip="Open a File.">
            <ui:DropDownButton.Content>
                <Image Source="/CannedBytes.CommandLineGui;component/Resources/Add File.png" />
            </ui:DropDownButton.Content>
            <ui:DropDownButton.DropDown>
                <ContextMenu>
                    <MenuItem Header="Open..." Command="cmd:AppCommands.FileOpen" />
                    <MenuItem Header="New..." Command="cmd:AppCommands.FileNew" />
                </ContextMenu>
            </ui:DropDownButton.DropDown>
        </ui:DropDownButton>

        <ui:DropDownButton Grid.Column="1" ToolTip="Save a File.">
            <ui:DropDownButton.Content>
                <Image Source="/CannedBytes.CommandLineGui;component/Resources/Save.png" />
            </ui:DropDownButton.Content>
            <ui:DropDownButton.DropDown>
                <ContextMenu>
                    <MenuItem Header="Save" Command="cmd:AppCommands.FileSave" />
                    <MenuItem Header="Save As..." Command="cmd:AppCommands.FileSaveAs" />
                    <MenuItem Header="Save All" Command="cmd:AppCommands.FileSaveAll" />
                </ContextMenu>
            </ui:DropDownButton.DropDown>
        </ui:DropDownButton>
        <ui:DropDownButton Grid.Column="2" ToolTip="Command Line Tool.">
            <ui:DropDownButton.Content>
                <Image Source="/CannedBytes.CommandLineGui;component/Resources/Play.png" />
            </ui:DropDownButton.Content>
            <ui:DropDownButton.DropDown>
                <ContextMenu>
                    <MenuItem Header="Copy" Command="cmd:AppCommands.EditCopy" />
                    <MenuItem Header="Execute..." Command="cmd:AppCommands.ExecuteCommandLine" />
                </ContextMenu>
            </ui:DropDownButton.DropDown>
        </ui:DropDownButton>

        <ctrl:Help DataContext="{Binding Path=ToolHelpInfo, Mode=OneTime}" Grid.Column="3" HorizontalAlignment="Right"/>
        <Button Name="CloseTool" Command="cmd:AppCommands.FileClose" Grid.Column="4" Margin="2,4,4,4" ToolTip="Close this file.">
            <Image Source="/CannedBytes.CommandLineGui;component/Resources/Exit.png" />
        </Button>

    </Grid>

</UserControl>